home *** CD-ROM | disk | FTP | other *** search
- /* This code comes from a complete ARC file with a demonstration program and
- documentation. If you do not have the whole ARC, it is available from the
- MSOFT forum on CompuServe.
- */
-
- #include <dos.h>
- #include <signal.h>
-
- int mygetch()
- {
- void int23();
- int c;
-
- if ((c = bdos(7, 0, 0) & 0x00FF) == 0x03) int23();
- else return c;
- }
-
- void handler()
- {
- void printf();
-
- printf("Got ^C");
- signal(SIGINT, handler);
- }
-
- void main()
- {
- int c;
-
- signal(SIGINT, handler);
- while((c = mygetch()) != 26) printf("%02x", c);
- }
-